import Vue from "vue";
import VueRouter from "vue-router";
import Layout from "@/views/Layout";
import Home from "@/views/Home";
import Search from "@/views/Search";
import Article from "@/views/Article";
import MyInfo from "@/views/MyInfo";
import City from "@/views/City";
import Login from "@/views/Login";
Vue.use(VueRouter);
const routes = [
  {
    path: "/",
    redirect: "/layout",
  },
  {
    path: "/layout",
    component: Layout,
    redirect: "/layout/home",
    children: [
      {
        path: "home",
        component: Home,
      },
      {
        path: "search",
        component: Search,
      },
      {
        path: "article",
        component: Article,
      },
      {
        path: "myInfo",
        component: MyInfo,
      },
    ],
  },
  {
    path: "/city",
    component: City,
  },
  {
    path: "/login",
    component: Login,
  },
];
const router = new VueRouter({
  routes,
});
export default router;
